package com.tj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tj.pojo.Employee;
import com.tj.service.EmployeeService;
import com.tj.mapper.EmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.util.List;


/**
* @author t
* @description 针对表【employee(员工信息)】的数据库操作Service实现
* @createDate 2023-04-25 21:48:54
*/
@Service
public class EmployeeServiceImpl implements EmployeeService{
    @Autowired
    private EmployeeMapper employeeMapper;


    @Override
    public Employee selectByUsername(Employee employee) {
        return employeeMapper.getByUsername(employee);
    }

    @Override
    public int addEmployee(Employee employee) {
        return employeeMapper.addEmployee(employee);
    }

    @Override
    public List<Employee> getPageEmployee(int page, int pageSize, String name) {
        return employeeMapper.getPageEmployee((page-1)*pageSize,pageSize,name);
    }

    @Override
    public int updateEmploy(Employee employee) {
        return employeeMapper.updateEmployee(employee);
    }

    @Override
    public Employee getById(int id) {
        return employeeMapper.getById(id);
    }

}




